package cn.anquing.util;

import java.io.File;

public class DeleteFileUtil {
	/** 
	 * 删除单个文件 
	 * @param   sPath    被删除文件的文件名 
	 * @return 单个文件删除成功返回true，否则返回false 
	 */  
	public static boolean deleteFile(String path,String fileName) {
		
		boolean flag = false;
		String realPath = path+fileName;
		File file = new File(realPath);
	    // 路径为文件且不为空则进行删除  
	    if (file.isFile() && file.exists()) {
	        file.delete();
	        flag = true;
	    }  
	    return flag;
	}
	
	public static void main(String[] args) {
		boolean flag = DeleteFileUtil.deleteFile("D:/document/git/dida_backstage/src/main/webapp/business/logo/", "201703201039018562630136.jpg");
		
		System.out.println(flag);
	}

}
